import os

from dotenv import load_dotenv
from langchain_openai import ChatOpenAI

load_dotenv()


# =========================
# 模型配置
# =========================
def create_chat_client():
    return ChatOpenAI(
        api_key=os.getenv("DASHSCOPE_KEY"),
        base_url=os.getenv("DASHSCOPE_OPENAI_URL"),
        model=os.getenv("DASHSCOPE_QWEN_PLUS"),
        verbose=False
    )


def create_vl_client():
    return ChatOpenAI(
        api_key=os.getenv("DASHSCOPE_APIKEY"),
        base_url="https://dashscope.aliyuncs.com/compatible-mode/v1",
        model=os.getenv("DASHSCOPE_QWEN_VL_PLUS"),
        verbose=True,
    )
